package com.hundsun.cprs.yyt.service.form.field.wrap;

import com.hundsun.cprs.yyt.service.form.dto.FormAttrInfo;
import com.hundsun.cprs.yyt.service.form.dto.FormInfo;

public abstract class AbstractField extends FormAttrInfo {
    
    private FormAttrInfo formAttrInfo;
    
    private FormInfo form;
    
    public AbstractField(FormAttrInfo formAttrInfo, FormInfo form){
        this.formAttrInfo = formAttrInfo;
        this.form = form;
        render();
    }
    
    public FormAttrInfo getObject(){
        return this.formAttrInfo;
    }
    
    protected void render(){
        //交由子类实现,初始化各自特有的属性
    }
    
    
    /**
     * 是否同行展示
     * @return
     */
    public boolean isSameRowShow(){
        return getIsSameRow() == null?false:getIsSameRow() == 1?true:false;
    }
    
    public FormInfo getForm() {
        return form;
    }
    
    //包装原属性及值，获取具体指委托给原对象
    @Override
    public Long getFormId() {
         return formAttrInfo.getFormId();
    }

    @Override
    public String getAttrValue() {
         return formAttrInfo.getAttrValue();
    }

    @Override
    public Long getId() {
         return formAttrInfo.getId();
    }

    @Override
    public String getType() {
         return formAttrInfo.getType();
    }

    @Override
    public String getAttrName() {
         return formAttrInfo.getAttrName();
    }

    @Override
    public String getAttrKey() {
         return formAttrInfo.getAttrKey();
    }

    @Override
    public Integer getStatus() {
         return formAttrInfo.getStatus();
    }

    @Override
    public Integer getMaxLength() {
         return formAttrInfo.getMaxLength();
    }

    @Override
    public String getIsDeleted() {
         return formAttrInfo.getIsDeleted();
    }

    @Override
    public Integer getAttrWidth() {
         return formAttrInfo.getAttrWidth();
    }

    @Override
    public Integer getAttrHeight() {
         return formAttrInfo.getAttrHeight();
    }

    @Override
    public Integer getSort() {
         return formAttrInfo.getSort();
    }

    @Override
    public String getTips() {
         return formAttrInfo.getTips();
    }

    @Override
    public String getValueContent() {
         return formAttrInfo.getValueContent();
    }

    @Override
    public String getIsRequired() {
         return formAttrInfo.getIsRequired();
    }

    @Override
    public String getIsRequiredTips() {
         return formAttrInfo.getIsRequiredTips();
    }

    @Override
    public String getIsUnique() {
         return formAttrInfo.getIsUnique();
    }

    @Override
    public String getIsUniqueTips() {
         return formAttrInfo.getIsUniqueTips();
    }

    @Override
    public String getCheckRule() {
         return formAttrInfo.getCheckRule();
    }

    @Override
    public String getCheckRuleTips() {
         return formAttrInfo.getCheckRuleTips();
    }

    @Override
    public Integer getIsSameRow() {
         return formAttrInfo.getIsSameRow();
    }

    @Override
    public Integer getValueSource() {
         return formAttrInfo.getValueSource();
    }

    @Override
    public String getRefAttrKey() {
         return formAttrInfo.getRefAttrKey();
    }
    
}
